import { lazy } from 'react'
// import { createBrowserRouter } from 'react-router-dom'

import ValidAuth from '../utils/ValidAuth'
const Home = lazy(() => import('../pages/home'))
const Login = lazy(() => import('../pages/login'))
const NotFound = lazy(() => import('../pages/notFound'))
// const router = createBrowserRouter()

// export default router

export const constRoute = [
  {
    path: '/',
    element: (
      <ValidAuth needLogin={true} redirectTo="/login">
        <Home />
      </ValidAuth>
    )
  },
  {
    path: '/login',
    element: (
      <ValidAuth needLogin={false} redirectTo="/dashboard">
        <Login />
      </ValidAuth>
    )
  },
  {
    path: '*',
    element: <NotFound />
  }
]
